function validate_() {

    console.info("##########################");

    var code = document.getElementById('code').value;

    var password = document.getElementById('password').value;

    var confirmedPassword = document.getElementById('confirmedPassword').value;

    var phoneNumber = document.getElementById('phoneNumber').value;

    var qq = document.getElementById('qq').value;

    var email = document.getElementById('email').value;

    var area = document.getElementById('area').value;

    var flag = 0;

    //判断Code
    flag = checkCode(code);
    if(flag != 0){
        document.getElementById('codeInfo').innerHTML="<font color='red'>账号不能为空</font>"
        return false;
    }
    //判断密码
    flag = checkPassword(password);
    alert(flag);
    if(flag != 0){
        document.getElementById('passwordInfo').innerHTML="<font color='red'>密码不能为空</font>";
        return false;
    }
    //检查确认密码
    flag = checkConfirmedPassword(password,confirmedPassword);
    if(flag != 0){
        document.getElementById('passwordInfo').innerHTML="<font color='red'>两次密码不一致</font>";
        return false;
    }
    //检查电话号码
    flag = checkPhoneNumber(phoneNumber);
    if(flag != 0){
        document.getElementById('passwordInfo').innerHTML="<font color='red'>手机号码错误!</font>";
        return false;
    }
    //检查qq
    flag = checkQq(qq);
    if(flag != 0){
        document.getElementById('passwordInfo').innerHTML="<font color='red'>qq号码错误!</font>";
        return false;
    }

    //检查邮箱
    flag = checkEmail(email);
    if(flag != 0){
        document.getElementById('passwordInfo').innerHTML="<font color='red'>邮箱格式错误！</font>";
        return false;
    }
    //检查地区
    flag = checkArea(area);
    if(flag != 0){
        document.getElementById('').innerHTML = "<font color='red'>地区不能为空！</font>";
    }
    //检查协议
    flag = checkAgree();
    if(flag != 0){
        document.getElementById('').innerHTML = "<font color='red'>请同意协议！</font>";
    }
    return flag;
}

function checkCode( code) {
    if(code == ''){
        return 1;
    }
}

function checkPassword(password) {
    if (password.length <6 || password.length >12){
        return 1;
    }
    return 0;
}

function checkConfirmedPassword(password, confirmPassword) {
    if(password != confirmPassword){
        return 1;
    }
    return 0;
}
function checkPhoneNumber(phoneNumber) {
    if(!(/^1[34578]\d{9}$/.test(phoneNumber))){
        return 1;
    return 0;
}
function checkQq(qq) {

    if(!/^ [1-9]\d[6,12] $/.test(qq)){
        return 1;
    }
    return 0;
}
function checkEmail(email) {

    if(/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(email)){
       return 1;
    }
    return 0;
}
    return true;
}

function checkArea(area) {
    if(area == ''){
        return 1;
    }
    return 0;
}
function checkAgree(agree) {
    if(agree == false){
        return 1;
    }
    return 0;
}
